﻿cmake_minimum_required(VERSION 3.10)

project(Lisp)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_BUILD_TYPE "Debug")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_C_COMPILER "gcc")

file(GLOB_RECURSE LISP_CORE_SRCS "Lisp/*.cpp")
add_library(Lisp-Core STATIC ${LISP_CORE_SRCS})
target_include_directories(Lisp-Core PUBLIC "Lisp/")

add_executable(Lisp_Step0 "Step0_Rep.cpp" "Lisp/Readline.cpp")
target_include_directories(Lisp_Step0 PUBLIC "Lisp/")

add_executable(Lisp_Step1 "Step1_Read_And_Print.cpp")
target_link_libraries(Lisp_Step1 Lisp-Core)

add_executable(Lisp_Step2 "Step2_Eval.cpp")
target_link_libraries(Lisp_Step2 Lisp-Core)

add_executable(Lisp_Step3 "Step3_Env.cpp")
target_link_libraries(Lisp_Step3 Lisp-Core)

add_executable(Lisp_Step4 "Step4_If_Fn_Do.cpp")
target_link_libraries(Lisp_Step4 Lisp-Core)

add_executable(Lisp_Step5 "Step5_TCO.cpp")
target_link_libraries(Lisp_Step5 Lisp-Core)

add_executable(Lisp_Step6 "Step6_File.cpp")
target_link_libraries(Lisp_Step6 Lisp-Core)

add_executable(Lisp_Step7 "Step7_Quote.cpp")
target_link_libraries(Lisp_Step7 Lisp-Core)

add_executable(Lisp_Step8 "Step8_Macros.cpp")
target_link_libraries(Lisp_Step8 Lisp-Core)

add_executable(Lisp_Step9 "Step9_Try.cpp")
target_link_libraries(Lisp_Step9 Lisp-Core)

add_executable(Lisp_StepA "StepA_Lisp.cpp")
target_link_libraries(Lisp_StepA Lisp-Core)
